﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using Abexi.Golf.Common;
using Abexi.Golf.DataAccess;

namespace Abexi.Golf.BusinessLogic
{
    public class PersonFactory
    {
        private static AbexiGolfEntities _abexiGolfEntities = new AbexiGolfEntities();
        
        public static Person CreatePerson(Person person)
        {
            //_abexiGolfEntities.AddToPeople(person);
            _abexiGolfEntities.SaveChanges();
            
            return person;
        }

        public static void RemovePerson(Person person)
        {
            //_abexiGolfEntities.DeleteObject(person);
            person.IsActive = false;

            _abexiGolfEntities.SaveChanges();
        }

        //public static List<Person> GetAllPerson()
        //{
        //    var people = from p in _abexiGolfEntities.People
        //                 select p;

        //    return people.ToList();
        //}
    }
}
